<!-- NotFound.vue -->
<template>
  <el-col class="box" :sm="12" :lg="6">
    <el-result class="result" icon="error" title="404" :sub-title="$t('sub_title')">
      <template #extra>
        <el-button type="primary" @click="$router.push('/')">{{ $t("subBack") }}（{{num}}）</el-button>
      </template>
    </el-result>
  </el-col>
</template>

<script setup>
const num = ref(3)
const inter = setInterval(() => {
  if(num.value == 0){
    window.location.href = window.location.origin
  }else{
    num.value--
  }
  
}, 1000);

onBeforeUnmount(()=>{
  clearInterval(inter)
})
</script>

<style scoped lang="less">
.box {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100vh;
  .result {
    transform: scale(2);
    position: relative;
    top: -50px;
  }
}
</style>
